<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <title>Claude Code Web UI</title>
    <script>
      // Prevent flash of unstyled content by setting theme class early
      (function () {
        const storedTheme = localStorage.getItem("claude-code-webui-theme");
        let theme = null;
        try {
          theme = storedTheme ? JSON.parse(storedTheme) : null;
        } catch {
          // If parsing fails, fall back to null
          theme = null;
        }
        
        if (
          theme === "dark" ||
          (!theme && window.matchMedia("(prefers-color-scheme: dark)").matches)
        ) {
          document.documentElement.classList.add("dark");
        } else {
          document.documentElement.classList.remove("dark");
        }
      })();
    </script>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>
